// <copyright file="NodeSource.asmx.cs" company="YUIAsp.Net">
// Copyright (c) 2009 All Right Reserved
// </copyright>
// <author>raul popescu</author>
// <email>dev@yuiasp.net</email>
// <date>2009-01-30</date>
// <summary>YUIAsp.Net File</summary>

using System.Collections.Generic;
using System.Web.Services;
using YUIAspNet;

namespace YUIAspNetDemo.TreeView
{
    /// <summary>
    /// Summary description for NodeSource
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
    [System.Web.Script.Services.ScriptService]
    public class NodeSource : System.Web.Services.WebService
    {

        [WebMethod]
        public TreeNode[] GetChildNodes(TreeNode node)
        {
            //Thread.Sleep(3000);

            return new List<TreeNode>
            {
                new TreeNode{ Text = node.Value+" 1" },
                new TreeNode{ Text = node.Value+" 2" },
                new TreeNode{ Text = node.Value+" 3" }
            }.ToArray();
        }
    }
}
